<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>

        let str = '我得到了惩罚';
        let arr = str.split('');
        arr = arr.reverse();
        str = arr.join('');
        console.log(str);

        let result = 'hajidexuduonianqiandechuantian';
        let newStr = '';
        for (let i = 0; i < result.length; i++) {
            let temp = result[result.length - 1 - i];
            console.log(temp);
            newStr = newStr + temp;
        }
        console.log(newStr);

    </script>
</body>
</html>